package com.dayu.finecomm.iot.params;

import com.alibaba.fastjson.annotation.JSONField;

/**
 * Iot Cmd配置信息
 * 
 * @author XuJialiang
 * @since 2017-09-06 15:45:12
 * @version V1.0.0
 */
public class IotCmdParam extends IotPlatParam {

	@JSONField(name = "deviceId")
	public String deviceId;

	@JSONField(name = "method")
	public String method;

	@JSONField(name = "paras")
	public String paras;

	@JSONField(name = "commandId")
	public String commandId;

	public static class PostCmd {
		@JSONField(name = "deviceId")
		public String deviceId;

		@JSONField(name = "requestId")
		public String requestId;

		@JSONField(name = "callbackUrl")
		public String callbackUrl;

		@JSONField(name = "expireTime")
		public int expireTime = -1;

		public static class Command {
			@JSONField(name = "serviceId")
			public String serviceId;

			@JSONField(name = "method")
			public String method;

			@JSONField(name = "paras")
			public String paras;
		}

		@JSONField(name = "command")
		public Command command;
	}

	@JSONField(name = "postCmd")
	public PostCmd postCmd;

	public static class QueryCommands {
		@JSONField(name = "deviceId")
		public String deviceId;

		@JSONField(name = "pageNo")
		public int pageNo = -1;

		@JSONField(name = "pageSize")
		public int pageSize = -1;

		@JSONField(name = "startTime")
		public String startTime;

		@JSONField(name = "endTime")
		public String endTime;
	}

	@JSONField(name = "queryCmds")
	public QueryCommands queryCmds;

	public static class ModifyCommand {
		@JSONField(name = "deviceId")
		public String deviceId;

		@JSONField(name = "commandId")
		public String commandId;

		public static class Result {
			@JSONField(name = "resultCode")
			public String resultCode;

			@JSONField(name = "resultDetail")
			public String resultDetail;
		}

		@JSONField(name = "result")
		public Result result;
	}

	@JSONField(name = "modifyCmd")
	public ModifyCommand modifyCmd;

	public static class QueryCmd {
		@JSONField(name = "deviceId")
		public String deviceId;

		@JSONField(name = "commandId")
		public String commandId;
	}

	@JSONField(name = "queryCmd")
	public QueryCmd queryCmd;
}
